package com.lxp.modules.gyy.controller;

import com.lxp.common.core.domain.AjaxResult;
import com.lxp.modules.gyy.domain.HrDepartment;
import com.lxp.modules.gyy.domain.HrEmployee;
import com.lxp.modules.gyy.domain.vo.EmpParam;
import com.lxp.modules.gyy.service.HrEmployeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/gyy/employee")
@Api(tags = "工业云人员接口")
@Slf4j
public class HrEmployeeController {
    @Resource
    private HrEmployeeService hrEmployeeService;

    @ApiOperation("根据部门id查询员工")
    @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = HrEmployee.class)))
    @PostMapping("/getEmpByDeptId")
    public AjaxResult getEmpByDeptId(@RequestBody EmpParam param) {
        List<HrEmployee> list = hrEmployeeService.getList(param);
        return AjaxResult.success(list);
    }

}
